import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Bwlayout from "../views/layout/layout";
import Booklist from "../views/booklist/booklist";
import Xiangqing from "../views/xiangqing/xiangqing";
import Login from "../views/login/login";
import List from "../views/list/list";
import Fenlei from "../views/fenlei/fenlei";
import { HomeOutlined, HeartTwoTone, SmileTwoTone } from "@ant-design/icons";
export const menurouter = [
  {
    path: "/booklist",
    name: "文章列表",
    icon: <HomeOutlined />,
    element: <Booklist />,
  },
  {
    path: "/xiangqing/:id",
    name: "详情页",
    icon: <HeartTwoTone twoToneColor="#eb2f96" />,
    element: <Xiangqing />,
  },
  {
    path: "/list",
    name: "列表页",
    icon: <SmileTwoTone />,
    element: <List />,
  },
  {
    path: "/fenlei",
    name: "分类页",
    icon: <HeartTwoTone twoToneColor="#eb2f96" />,
    element: <Fenlei />,
  }
];
const routes = [
  {
    path: "/",
    element: <Bwlayout />,
    children: menurouter,
  },
  {
    path: "/login",
    element: <Login />,
  },
];

const router = createBrowserRouter(routes);
export default router;
